<template>
  <div class="back-btn abs" @click="changeMode">返回</div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  methods: {
    changeMode() {
      let mode = ''
      if (this.mode === 'building') {
        mode = 'global'
      } else {
        mode = 'building'
      }
      this.$store.commit('patch_mode', mode)
    }
  },
  computed: {
    ...mapState({
      mode: state => state.mode
    })
  }
}
</script>

<style lang="less" scoped>
.back-btn{
  width: 90px;
  height: 38px;
  background-image: url(~@/assets/images/back_btn.png);
  background-size: 100% 100%;
  font-size: 16px;
  line-height: 38px;
  left: 340px;
  top: 32px;
  cursor: pointer;
  pointer-events: initial;
  padding-left: 10px;
}
</style>
